<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		<style type="text/css">
			.active {
				background: skyblue;
			}

			.page {
				height: 200px;
				width: 200px;
			}
		</style>
		<script src="js/vue.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<div id="app">
			<div class="page" :class="{active:isTrue}"></div>
			<!-- 通过对象的方式决定是否存在某个类 -->
			<br>
			<!-- 还可以直接放置对象： -->
			<div class="page" :class="styleObj"></div>
			<br>
			<!-- 还可以直接放置数组 -->
			<div class="page" :class="styleArr"></div>
			<br>
			<!-- 还可以放置字符串 -->
			<div class="page" :class="styleStr"></div>
			<br>
			<!-- 数组和对象混合使用 -->
			<div class="page" :class="styleArrObj"></div>
		</div>

		<script type="text/javascript">
			var app = new Vue({
				el: "#app",
				data: {
					isTrue:true,
					styleObj:{active:true,test:true,"col-g-6":true},//可以写多个
					styleArr:["col-xs-12","red-bg"],
					styleStr:"abc cde efj",
					styleArrObj:["abc",{active:true}]
				},
			})
		</script>
	</body>
</html>
